import RequestMethod from '@/fierce/api/request-method';

export function generateBaseApis(): ApiModule['apis'] {
  return {
    fetchOne: {
      uri: '',
      method: RequestMethod.GET,
    },
    fetchList: {
      uri: 'list',
      method: RequestMethod.GET,
    },
    fetchPage: {
      uri: 'page',
      method: RequestMethod.GET,
    },
    create: {
      uri: '',
      method: RequestMethod.POST,
    },
    modify: {
      uri: '',
      method: RequestMethod.PUT,
    },
    batchCreate: {
      uri: 'batch',
      method: RequestMethod.POST,
    },
    batchModify: {
      uri: 'batch',
      method: RequestMethod.PUT,
    },
    delete: {
      uri: '',
      method: RequestMethod.DELETE,
    },
    batchDelete: {
      uri: 'batch',
      method: RequestMethod.DELETE,
    },
    fetchMeta: {
      uri: 'meta',
      method: RequestMethod.GET,
    },
    fetchOptions: {
      uri: 'options',
      method: RequestMethod.GET,
    },
    export: {
      uri: 'export',
      method: RequestMethod.GET,
    },
    import: {
      uri: 'import',
      method: RequestMethod.POST,
    },
    importData: {
      uri: 'import/data',
      method: RequestMethod.POST,
    },
    getImportTemplate: {
      uri: 'import/template',
      method: RequestMethod.GET,
    },
    previewImportData: {
      uri: 'import/preview',
      method: RequestMethod.POST,
    },
  };
}
